Introduction

This articles gives a quick overview of mapping points between FAFB14 (as used by the “walled garden” and Virtual Fly Brain and FlyWire.

Basic point mapping

Some known points

Compare displacements (in nm) for forward or inverse mapping

A sample neuron. First map the points

data("AV4b1", package='catmaid')
before=xyzmatrix(AV4b1)
after=fafb2flywire(before)

Then some stats and a quick histogram

hist(d, br=20, main='Displacement /µm')

sample_points_in_surf <- function(x, n){
  x=as.mesh3d(x)
  bb=boundingbox(x)
  mm=mapply(runif, min=bb[1,], max=bb[2,], n = n)
  colnames(mm)=c("X","Y","Z")
  data.frame(mm, inside=pointsinside(mm,x))
}
jet.colors<-colorRampPalette(c('navy','cyan','yellow','red'))
nclear3d();
spheres3d(xyzmatrix(sxyz.in), col=jet.colors(10)[cut(delta, breaks = 10)], rad=2000)

You must enable Javascript to view this page properly.

Round trip error

Let’s send those points back again

deltas=sxyz.fafb2-xyzmatrix(sxyz.in)
delta=rowSums(deltas[,c("X","Y")])
hist(delta, main = "Round Trip Error", xlab='delta /nm')

Mapping anything

To map complex objects, use xform_brain()

choose_segmentation("flywire")
open_fafb_ngl(mainbranch(AV4b1.fw), coords.only = TRUE)
#> [1] "88371.25,40478.75,3668"

catmaidcatmaid

Note the relevant links:

Load the flywire mesh

av4.fwm=read_cloudvolume_meshes('720575940618054533')

And plot with the CATMAID skeleton

It’s obvious that both are only partially traced, but they are still the same neuron.